5a01a776d267bac769d7a0852c9d7d27c0a619a1,kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-processors/src/main/java/org/kie/workbench/common/stunner/core/processors/MainProcessor.java,MainProcessor,processDefinitions,#Set#Element#RoundEnvironment#,327
Before Change
// PropertySets fields.
processFieldNames( classElement, propertyClassName, ANNOTATION_PROPERTY_SET, processingContext.getDefinitionAnnotations().getPropertySetFieldNames() );
// Properties fields.
processFieldNames( classElement, propertyClassName, ANNOTATION_PROPERTY, processingContext.getDefinitionAnnotations().getPropertyFieldNames() );
// -- Morphing annotations --
// MorphBase - defaultType
MorphBase morphBaseAnn = e.getAnnotation( MorphBase.class );
After Change
RoundEnvironment roundEnv ) throws Exception {
final boolean isClass = e.getKind() == ElementKind.CLASS;
if ( isClass ) {
TypeElement classElement = (TypeElement) e;
PackageElement packageElement = (PackageElement) classElement.getEnclosingElement();
String propertyClassName = packageElement.getQualifiedName().toString() + "." + classElement.getSimpleName();
Map<String, String> baseTypes = processingContext.getDefinitionAnnotations().getBaseTypes();
TypeElement parentElement = getDefinitionInheritedType( classElement );
if ( null != parentElement && !baseTypes.containsKey( propertyClassName ) ) {
PackageElement basePackageElement = (PackageElement) parentElement.getEnclosingElement();
String baseClassName = basePackageElement.getQualifiedName().toString() + "." + parentElement.getSimpleName();
baseTypes.put( propertyClassName, baseClassName );
}
// Category fields.
processFieldName( classElement,
propertyClassName,
ANNOTATION_DEFINITION_CATEGORY,
processingContext.getDefinitionAnnotations().getCategoryFieldNames(),
true );
// Title fields.
processFieldName( classElement,
propertyClassName,
ANNOTATION_DEFINITION_TITLE,
processingContext.getDefinitionAnnotations().getTitleFieldNames(),
true );
// Description fields.
processFieldName( classElement,
propertyClassName,
ANNOTATION_DESCRIPTION,
processingContext.getDefinitionAnnotations().getDescriptionFieldNames(),
true );
// Labels fields.
processFieldName( classElement,
propertyClassName,
ANNOTATION_DEFINITION_LABELS,
processingContext.getDefinitionAnnotations().getLabelsFieldNames(),
true );
// Builder class.
processDefinitionModelBuilder( e, propertyClassName,
processingContext.getDefinitionAnnotations().getBuilderFieldNames() );
// Graph element.
Definition definitionAnn = e.getAnnotation( Definition.class );
TypeMirror mirror = null;
try {
Class<?> graphClass = definitionAnn.graphFactory();
} catch ( MirroredTypeException mte ) {
mirror = mte.getTypeMirror();
}
if ( null == mirror ) {
throw new RuntimeException( "No graph factory class specified for the @Definition." );
}
String fqcn = mirror.toString();
processingContext.getDefinitionAnnotations().getGraphFactoryFieldNames().put( propertyClassName, fqcn );
// PropertySets fields.
Map<String, Element> propertySetElements = getFieldNames( classElement, ANNOTATION_PROPERTY_SET );
if ( null != propertySetElements ) {
processingContext.getPropertySetElements().addAll( propertySetElements.values() );
processingContext.getDefinitionAnnotations().getPropertySetFieldNames().put( propertyClassName, new LinkedHashSet<>( propertySetElements.keySet() ) );
if ( propertySetElements.isEmpty() ) {
note( "Definition for type [" + propertyClassName + "] has no PropertySet members." );
}
}
// Properties fields.
Map<String, Element> propertyElements = getFieldNames( classElement, ANNOTATION_PROPERTY );
if ( null != propertyElements ) {
processingContext.getPropertyElements().addAll( propertyElements.values() );
processingContext.getDefinitionAnnotations().getPropertyFieldNames().put( propertyClassName, new LinkedHashSet<>( propertyElements.keySet() ) );
if ( propertyElements.isEmpty() ) {
note( "Definition for type [" + propertyClassName + "] has no Property members." );
}
}